﻿using System;
using System.Drawing;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace WgpgGUI
{
    [ValueConversion(typeof(Image), typeof(BitmapSource))]
    public sealed class ImageToBitmapSourceConverter : IValueConverter
    {
        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            return Photo.ImageToBitmapSource((Image)value);
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
